package com.library.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.library.entity.BorrowRecord;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.library.vo.PageVO;

/**
 * 借阅记录Service接口
 *
 * @author Library Team
 */
public interface BorrowRecordService extends IService<BorrowRecord> {

    /**
     * 分页查询借阅记录
     */
    PageVO<BorrowRecord> getBorrowRecordPage(Long current, Long size, Long userId);

    /**
     * 借阅书籍
     */
    boolean borrowBook(Long userId, Long bookId, Integer borrowDays);

    /**
     * 归还书籍
     */
    boolean returnBook(Long recordId);

    /**
     * 检查用户是否已借阅此书
     */
    boolean isBookBorrowedByUser(Long userId, Long bookId);

    /**
     * 获取用户当前借阅数量
     */
    int getCurrentBorrowCount(Long userId);

}
